﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

using Infrastructure.Core.Extension;

namespace SMG.Domain.Specifications
{

    public class NotSpecification<T> : Specification<T>
    {
        private ISpecification<T> _wrapped;

        public NotSpecification(ISpecification<T> wrapped)
        {
            this._wrapped = wrapped;
        }

        public override Expression<Func<T, bool>> GetExpression()
        {
            return _wrapped.GetExpression().Not();
        }
    }
    
}
